module Radix4BoothProduct #(
    parameter WIDTH = 68
) (
    input   logic [2:0]         y,
    input   logic [WIDTH-1:0]   x,
    output  logic [WIDTH-1:0]   p,
    output  logic               c
);

    wire sub_x  = ( y[2] &  y[1] & ~y[0]) | ( y[2] & ~y[1] & y[0]);
    wire add_x  = (~y[2] &  y[1] & ~y[0]) | (~y[2] & ~y[1] & y[0]);
    wire sub_2x = ( y[2] & ~y[1] & ~y[0]);
    wire add_2x = (~y[2] &  y[1] &  y[0]);

    // X[-1] = 0
    assign p[0] = (sub_x & ~x[0]) | (add_x & x[0]) | sub_2x;
    
    generate
        for (genvar i = 1; i < WIDTH; i++) begin : gen
            assign p[i] = (sub_x & ~x[i]) | (add_x & x[i]) 
                        | (sub_2x & ~x[i-1]) | (add_2x & x[i-1]);
        end
    endgenerate

    assign c = sub_x | sub_2x;
endmodule
